import pandas as pd
import numpy as np

left = pd.DataFrame({'key': ['foo', 'bar'], 'lval': [1, 2]})
right = pd.DataFrame({'key': ['foo', 'bar'], 'rval': [4, 5]})
print(left)
print("--------")
print(right)
print("--------")

# 合并: 出现笛卡尔乘积
df = pd.merge(left, right, on='key')
print(df)
